<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>品牌管理</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style>
        table input {
            border: none;
            width: 100%;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }
        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }
        input[type=text], input[type=tel], input[type=number], select {
            box-sizing: border-box;
            border-width: 0px;
            border-style: none;
            padding-right: 0px !important;
            padding-top: 0px !important;
            padding-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            padding-left: 6px;
        }

        input[type=text], input[type=tel], input[type=number], select {
            height: 24px;
            width: 100%;
            border: none;
            outline: none;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        table .td-module {
            background-color: #f8f8f8;
            line-height: 24px;
            font-weight: bold;
        }
        .span-a-btn {
            position: absolute;
            right: 10px;
            margin-right: 19px;
        }
    </style>
</head>

<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div id="div" style="margin-top: 12px">
        <div>
            <div class="box-body no-padding iframeH2" style="overflow: auto;margin-left: -10px;margin-top:-20px"
                 id="scrollDiv">
                <table class="table table-bordered text-center" id="week">
                    <tr>
                        <td colspan="4" class="no-print td-module">
                        <span style="text-align:center;height:18px">品牌管理</span>
                        <span class="span-a-btn" v-if="type!='edit'">
                            <a href="javascript:void(0);" class="a-btn" @click="addRow()">添加一行</a>
                            <a href="javascript:void(0);" class="a-btn" @click="delRow()">删除一行</a>
                        </span>
                        </td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;">
                        <td style="width: 25%;color:black;background-color:#F8F8F8">品牌</td>
                        <td style="width: 25%;color:black;background-color:#F8F8F8">户名</td>
                        <td style="width: 25%;color:black;background-color:#F8F8F8">收款银行</td>
                        <td style="width: 25%;color:black;background-color:#F8F8F8">银行账号</td>
                    </tr>
                    <tr class="td-row2 td-value" style="height:30px;" v-for="(item,i) in customer">
                        <td>
                            <select id="testBran" v-model="selectBran">
                            <option value="请选择品牌">请选择品牌</option>
                            <option v-for="itemB in itemsBran" v-bind:value="itemB.id">{{itemB.name}}</option>
                            </select>
                        </td>
                        <td>
                            <input type="text" id="bankName" v-model="item.bankName">
                        </td>
                        <td>
                            <input type="text" id="intermediaryBank" v-model="item.intermediaryBank">
                        </td>
                        <td>
                            <input type="text" id="bankAccount" v-model="item.bankAccount">
                        </td>
                    </tr>
                </table>
                <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
                    <input type="button" style="margin-left:20px;" v-if="type=='add'"
                           value="保存" class="btn btn-primary btn-sm" @click="save()"/>
                </div>
            </div>
        </div>
    </div>
</section>

</body>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="/page/device/manage/Template.js?t=42e28def"></script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var app = new Vue({
        el: '#app',
        data: {
            customer:{
                id:'',
                fkModelId:'',
                brandName:'',
                bankName:'',
                intermediaryBank:'',
                bankAccount:'',
            },
            selectBran:'请选择品牌',
            itemsBran: [],
            customer:[
                new Template.banks('')
            ],
        },
        methods: {
            save:function () {
                var that=this;
                var data=that.customer;
                $.wyui.postMethod('/deviceBrand/saveBrandBank.json', trimRN(data), function (r) {
                    alert("保存成功");
                    parent.refresh();
                    api.close();
                });
            },
            /*添加一行*/
            addRow: function () {
                var that = this;
                that.customer.push(new Template.banks('1'));
                alert(new Template.banks('1'))
                var num = that.customer.length - 1;
            },
            /*删除一行*/
            delRow: function () {
                alert(111)
                this.customer.splice(this.customer.length - 1, 1);
            },
            close:function () {
                api.close();
            },
            showDatePicker: function (e, index) {
                var that = this;
                console.log(index)
                WdatePicker({
                    onpicked: function (dp) {
                        that.customer.years = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod('/deviceBrand/getBankList.json',{},function (r) {
                console.log(r);
                that.customer = r.banks;
            })
            $.wyui.postMethod('/deviceBrand/getBrandList2.json',{},function (r) {
                console.log(r);
                that.itemsBran = r.brands;
            })
            }

    })
</script>

</html>